import 'package:tencent_cloud_chat_uikit/czm_method/method_type_def.dart';

/// 创作猫方法桥接
class CZMMethodBridge {
  CZMMethodBridge._internal();

  static CZMMethodBridge getInstance() {
    _instance ??= CZMMethodBridge._internal();
    return _instance!;
  }

  static CZMMethodBridge? _instance;

  void registerMethodCallBack({
    required ContactListInitStateCallBack contactInitStateCallBack,
    required TextFieldAuth textFieldAuth,
    required GroupOwnerAdminRevokeMessage groupOwnerAdminRevokeMessage,
    required IMWhiteListAuth imWhiteListAuth,
  }) {
    _contactInitStateCallBack = contactInitStateCallBack;
    _textFieldAuth = textFieldAuth;
    _groupOwnerAdminRevokeMessage = groupOwnerAdminRevokeMessage;
    _imWhiteListAuth = imWhiteListAuth;
  }

  /// 联系人列表初始化回调
  ContactListInitStateCallBack get contactInitStateCallBack => _contactInitStateCallBack;
  late ContactListInitStateCallBack _contactInitStateCallBack;

  /// 输入框鉴权
  TextFieldAuth get textFieldAuth => _textFieldAuth;
  late TextFieldAuth _textFieldAuth;

  /// IM白名单用户鉴权
  IMWhiteListAuth get imWhiteListAuth => _imWhiteListAuth;
  late IMWhiteListAuth _imWhiteListAuth;

  /// 群主管理员撤回群成员消息
  GroupOwnerAdminRevokeMessage get groupOwnerAdminRevokeMessage => _groupOwnerAdminRevokeMessage;
  late GroupOwnerAdminRevokeMessage _groupOwnerAdminRevokeMessage;
}
